<%@ page language="java" import="com.alibaba.fastjson.JSONObject" pageEncoding="UTF-8" %>
<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="weaver.general.Util" %>
<%--获取传阅数量--%>
<%
    JSONObject jsonData = new JSONObject();
    RecordSet rs = new RecordSet();
    try {
        int fwh = 0;
        String fwzh = Util.null2String(request.getParameter("fwzh"));
        String n = Util.null2String(request.getParameter("n"));
        int lcid = Util.getIntValue(request.getParameter("lcid"));
        rs.executeQuery("select fwh from uf_fwzh where lc=?", lcid);
        if(rs.next()){
            fwh = Util.getIntValue(rs.getString(1), 0);
        }else {
            rs.executeQuery("select max(fwh) from uf_fwzh where fwz=? and n=?", fwzh, n);
            rs.next();
            fwh = Util.getIntValue(rs.getString(1), 0)+1;
        }
        jsonData.put("fwh", fwh);
    } catch (Exception e) {
        e.printStackTrace();
    }

    out.print(jsonData.toJSONString());
%>
